Previous Book Contents Book Index Next

Inside Macintosh: QuickDraw GX Objects /
Chapter 2 - Shape Objects / Shape Objects Reference
Functions / Directly Manipulating a Shape's Geometry


GXLockShape

You can use the GXLockShape function to load a shape into memory and lock its geometry into a fixed memory location.

void GXLockShape(gxShape target);
target
A reference to the shape to be loaded and locked.
DESCRIPTION
The GXLockShape function prevents a shape from being relocated. You must set the gxDirectShape attribute of the target shape before calling this function.

To avoid fragmenting the QuickDraw GX heap, call the GXUnlockShape function as soon as possible after calling GXLockShape.

To directly edit a shape's geometry, call GXLockShape followed by GXGetShapeStructure. After editing, call GXUnlockShape followed by GXChangedShape.

SPECIAL CONSIDERATIONS
The GXLockShape function is not related to the gxLockedShape shape attribute. If you set the gxLockedShape attribute, you cannot alter the shape's geometry with functions such as GXSetPoint and GXSetRectangle, described in the geometric shapes chapter of Inside Macintosh: QuickDraw GX Graphics. Setting gxLockedShape has no effect on the direct manipulation of geometry using the calls described here.

In low memory conditions with fragmented memory, QuickDraw GX can unlock locked objects and relocate them. Be careful about making memory-intensive calls after locking an object.

ERRORS, WARNINGS, AND NOTICES
Errors 
out_of_memory 
shape_is_nil 
graphic_type_does_not_have_a_structure(debugging version)
Notices (debugging version) 
directShape_attribute_set_as_side_effect
SEE ALSO
The GXUnlockShape, GXGetShapeStructure, and GXChangedShape functions are described in the following three sections.

Shape attributes are described in the section "Shape Attributes" beginning on page 2-16. To set shape attributes, use the GXSetShapeAttributes function, described on page 2-74.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
7 JUL 1996